const EventEimtter = require('events')

class CustomEvent extends EventEimtter {
}

const ce = new CustomEvent()
ce.on('error', (err, time) => {
    console.log(err)
    console.log(time)
})

ce.emit('error', new Error('oppsliving'), Date.now())